package alg20241126;

public class Text {
    public String modifyString(String ss) {
        int n = ss.length();
        char[] s = ss.toCharArray();
        for (int i = 0; i < n; i++) {
            if(s[i] == '?'){
                for (char j = 'a'; j <= 'z'; j++) {
                    if((i == 0 || j != s[i-1])&&(i == n-1 || j != s[i+1])){
                        s[i] = j;
                    }
                }
            }
        }
        return String.valueOf(s);
    }

}
